/*
 * (c) 2019 <tanghaifeng-gz@loongson.cn> <pengren.mcu@qq.com>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 *
 */

#ifndef __LS2K_PC_EVB_CONFIG_H
#define __LS2K_PC_EVB_CONFIG_H

#define CONFIG_RECOVER

#include "ls2k1000_common.h"
#include "loongson_bootmenu.h"

#define BOARD_LS2K_PC_EVB

/* Loongson bootelf bootparam smbios */
#define CONFIG_LOONGSON_BOARD_NAME "LS2K1000-PC-EVB"

#undef CPU_CLOCK_RATE
#define CPU_CLOCK_RATE  900000000	/* 定义cpu核心频率为900 MHz */
#undef DDR_CLOCK_RATE
#define DDR_CLOCK_RATE  500000000	/* 定义ddr工作频率为500 MHz */

/* Framebuffer and LCD */
#if defined(CONFIG_VIDEO_LS1X)
#define LS1X_DC0
//#define LS1X_DC0_USE_DEMODE
#define LS1X_DC1
#define LS1X_DC1_USE_DEMODE
#define LS1X_DC_MAX 2
#endif

#define	CONFIG_EXTRA_ENV_SETTINGS					\
	CONSOLE_STDOUT_SETTINGS \
	LOONGSON_BOOTMENU \
	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
	"fdt_addr=" __stringify(FDT_LOAD_ADDR) "\0" \
	"rd_start=" __stringify(RAMDISK_START) "\0" \
	"rd_size=" __stringify(RAMDISK_SIZE) "\0" \
	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"					\
	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"				\
	"splashpos=m,m\0" \
	"video=" "VGA-1:1920x1080-32@60 video=VGA-2:1920x1080-32@60" "\0" \
	"panel0=" "vesa1920x1080@60" "\0" \
	"panel1=" "vesa1920x1080@60" "\0" \
	"root_dev=sda\0" \
	"syspart=1\0" \
	"update=1\0" \

//#define CONFIG_BOOTCOMMAND	"tftpboot ${loadaddr} uImage\;bootm ${loadaddr}"	/* Autoboot command	*/
#define CONFIG_BOOTCOMMAND	"setenv bootargs ${bootargs} mtdparts=${mtdparts} video=${video}\; \
sf probe\;nboot kernel\;bootm"

/* Boot beep */
#define BEEP_GPIO 35
#define BEEP_DEBUG_GPIO BEEP_GPIO	//用于启动过程的提示音

#define CONFIG_WATCHDOG_TIMEOUT_MSECS	(30 * 1000)

/* ls2k ddr配置 */
#define DDR3_DIMM
#define LSMC_2
//#define DDR_PARAM_018 0x4545454516100000
#define DDR_PARAM_018 0x2525252516100000
#define DDR_FREQ DDR_CLOCK_RATE/1000000

//#define TEMP_EXTREME
//#define DISABLE_DDR_A15
//#define NO_AUTO_TRFC

//#define ARB_LEVEL
#define AUTO_DDR_CONFIG

#endif	/* __LS2K_PC_EVB_CONFIG_H */
